﻿// Copyright (c) 2009 Kjetil Eraker Samuelsen
// This source is subject to the Microsoft Public License.
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
// All other rights reserved.

using System;
using Microsoft.Office.Interop.Outlook;
using Microsoft.Office.Core;

namespace Ksamuelsen.Office.Outlook.Addin.VDialer
{
    public partial class VDialerAddIn {
        private VDialerItemContextMenuHandler _ctxMenu;



        private void ThisAddIn_Startup(object sender, System.EventArgs e) {
            System.Windows.Forms.Application.EnableVisualStyles();
            OutlookManager.Init(Application);
            OutlookManager.AddOptionPage(typeof(VDialerConfigurationPropertyPage), Properties.Resources.PROP_PAGE_TITLE);

            _ctxMenu = new VDialerItemContextMenuHandler(Application);

        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e) {
            OutlookManager.Dispose();

            _ctxMenu.Dispose();
            _ctxMenu = null;
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }
        
        #endregion
    }
}
